package lc.位运算;

/**
 * @description:
 * @author: qian
 * @createDate: 2021/11/2
 */
public class 剑指Offer65_不用加减乘除做加法 {

    public int add(int a, int b) {
        while (b != 0) {
            int c = a ^ b;
            b = (a&b)<<1;
            a = c;
        }
        return a;
    }
}
